#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include"mystring.h"

int my_strlen(const char * str){

	int length = 0;
	const char * pos = str;
	while(*pos!='\0'){

		length++;
		pos++;
	}
	return length;
}

int my_countchar(const char * str,char c){

	int count = 0;
	const char * pos = str;
	while(*pos!='\0'){
	
		if(*pos == c)	count++;
		pos++;
	}
	return count;
}

void my_strupper(char * str){

	char * pos = str;
	while(*pos!='\0'){
		if(*pos >= 97 && *pos <= 122) *pos = *pos - 32;
		pos++;
	}
}

char * my_strchar(const char * str,char c){

	const char * pos = str;
	while(*pos!='\0'){
	
		if(*pos == c) return pos;
		pos++;
	}
	return NULL;
}
